package de.mp3player.repository;

import java.io.IOException;
import java.util.LinkedList;

public class FindAllMusic {
	
	private LinkedList<String>allsongs;
	//TODO Findalgorithmus aller Musikdateien auf der Festplatte implementieren
	private String fmp3 = "find / -type f -name '*.mp3'";
	private String fwav = "find / -type f -name '*.wav'";
	private Runtime rt;
	
	public FindAllMusic(){
		this.allsongs = new LinkedList<String>();
		this.rt = Runtime.getRuntime();
		try {
			find();
		} catch (Exception e) {e.printStackTrace();}
	}
	public LinkedList<String> getAllsongs() {
		return allsongs;
	}
	private void find() throws Exception{
		Process child = rt.exec(fmp3);
		child.waitFor();
		
	}

}
